package day06.JDK8Demo;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

public class Lian03 {
    public static void main(String[] args) {
        LocalDateTime time = LocalDateTime.of(2020, 11, 11, 11, 11, 11);
        int year = time.getYear();
        System.out.println("年为"+year);
        int yue = time.getMonthValue();
        System.out.println("月为"+yue);
        int ri = time.getDayOfMonth();
        System.out.println("日为"+ri);
        int dayOfYear = time.getDayOfYear();
        System.out.println("这是一年中的第"+dayOfYear+"天");
        DayOfWeek dayOfWeek = time.getDayOfWeek();
        System.out.println("星期为"+dayOfWeek);
        int minute = time.getMinute();
        System.out.println("分钟为"+minute);
        int hour = time.getHour();
        System.out.println("小时为"+hour);
    }
}
